package chapter_09;

public class Balance {
	// java chapter_09.Balance_01
	// 记住，当你执行该命令时你必须在MyPack的上级目录，或者把类路径环境变量设置成
	// 合适的值。
	String name;
	double bal;

	Balance(String n, double b) {
		name = n;
		bal = b;
	}
	
	void show() {
		if(bal<0)
		System.out.print("--> ");
		System.out.println(name + ": $" + bal);
	}
	
	public static void main(String args[]) {
		Balance current[] = new Balance[3];
		current[0] = new Balance("K. J. Fielding", 123.23);
		current[1] = new Balance("Will Tell", 157.02);
		current[2] = new Balance("Tom Jackson", -12.33);
		for(int i=0; i<3; i++) current[i].show();
	}
}
